$(function () {
  let token =localStorage.getItem('token')
  if (!token) {
    location.href = './login.html'
  }
  $('#logout-btn').on('click',function(e) {
    e.preventDefault ();
    layer.confirm('您要离开我了嘛', {icon: 3, title:'提示'}, function(index){
      //do something
      localStorage.removeItem('token')
      layer.close(index);
      location.href = './login.html'
    });
  })
})